package com.tencent.wxcloudrun.service.impl;

import com.tencent.wxcloudrun.dto.AddAddressRequest;
import com.tencent.wxcloudrun.dto.Address;
import com.tencent.wxcloudrun.mapper.AddressMapper;
import com.tencent.wxcloudrun.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lichongbing
 * @version 1.0.0
 * @createdate 2023/3/10 22:35
 * @description: TODO
 */
@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper mapper;
    @Override
    public int addAddress(Address address) {

        mapper.addAddress(address);


        return 0;
    }

    @Override
    public List<Address> queryAddress(String openid) {

        return mapper.queryAddress(openid);
    }

    @Override
    public int deleteAddress(String id) {
        return mapper.deleteAddress(id);
    }

    @Override
    public Address addressDetail(String id) {

        return  mapper.addressDetail(id);
    }

    @Override
    public Address defaultAddress(String openid) {
        return mapper.defaultAddress(openid);
    }

    @Override
    public int updateAddress(Address json) {
        return mapper.updateAddress(json);
    }
}
